package com.example.demo.simplefactory01;

public class testSimFac {
    public static void main(String[] args) {
        //加
        Operation operation = OperationFactory.createOperation("+");
        operation.setNumberA(1);
        operation.setNumberB(2);
        double result1 = operation.getResult();
        System.out.println(result1);
        //减
        Operation operation2 = OperationFactory.createOperation("-");
        operation2.setNumberA(1);
        operation2.setNumberB(2);
        double result2 = operation2.getResult();
        System.out.println(result2);
    }
}
